<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
				xmlns:h="http://java.sun.com/jsf/html"
				xmlns:p="http://primefaces.org/ui"
				xmlns:f="http://java.sun.com/jsf/core"
				xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:c="http://java.sun.com/jsp/jstl/core"
				template="./template.xhtml">

    <ui:define name="htmlHead">
        <title>#{bundle['nav.login']}</title>
    </ui:define>

	<ui:define name="topbar">
		#{bundle['nav.welcome']}
	</ui:define>

    <ui:define name="content">
		<div class="row">
			<div class="span8">
				<h:form class="form-horizontal"> 
					<fieldset>

                                            <legend>#{bundle['action.login']}</legend>

						<div class="control-group">
                                                    <h:outputLabel for="email" value="#{bundle['user.email']}" class="control-label" />  
							<div class="controls">
								<p:inputText id="email" required="true" label="id" value="#{userManager.email}" />
								<c:if test="#{not facesContext.validationFailed}"><p class="help-block">e.g: demo@mail.com</p></c:if>
								<h:message for="email" class="help-block" />
							</div>
						</div>

						<div class="control-group">
                                                    <h:outputLabel for="password" value="#{bundle['user.pass']}" class="control-label" /> 
							<div class="controls">
								<p:password id="password" required="true" label="password" value="#{userManager.password}" redisplay="true" feedback="false" /> 
								<c:if test="#{not facesContext.validationFailed}"><p class="help-block">e.g: demo</p></c:if>
								<h:message for="password" class="help-block"/>
							</div>
						</div>

						<div class="form-actions">
                                                    <p:commandButton value="#{bundle['action.login']}"  update="@form,:growl" action="#{userManager.login}" styleClass="btn btn-primary" />&nbsp;
							<p:commandButton value="#{bundle['action.cancel']}" type="reset" update="@form" action="#{userManager.loginReset()}" styleClass="btn" />
						</div>

					</fieldset>
				</h:form>
			</div>

			<div class="span4">
				<h3>#{bundle['nav.signin']}</h3>
				<p>#{bundle['nav.text.signin']}</p>
				<h:form>
                                    <p><h:link value="#{bundle['action.create.account']}" outcome="/signin" class="btn btn-success" /></p>
				</h:form>
				
				<hr />
				
                                <h3>#{bundle['nav.text.account']}</h3>
                                <p>#{bundle['nav.text.example1']} <code>demo@mail.com</code> #{bundle['nav.text.example2']} 
					<code>demo</code>. #{bundle['nav.text.example3']}
				</p>

			</div>

		</div>

    </ui:define>

</ui:composition>
